package com.liveneo.adapter.outinterface.util;

import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;


/**
  * @Description: 获取类的所有属性
  * @author liveneo-shuqw
  * @date 2016年9月26日 下午10:01:56
  * Copyright: Copyright (c) 2016 
  * Company: 北京朗泰
  * @version 3.0
  */
public class BeansUtil {

	public static String listBeans(Object model) throws Exception {  
        BeanInfo bi = Introspector.getBeanInfo(model.getClass());  
        PropertyDescriptor[] pds = bi.getPropertyDescriptors();  
        StringBuffer sf = new StringBuffer();
        for (int i = 0; i < pds.length; i++) {  
        	sf.append(pds[i].getName());  
             if(i != pds.length-1){
            	 sf.append(",");
             }
        }  
        return sf.toString();
    } 
	public static void main(String[] args) throws Exception {
		//System.out.println(listBeans(new PrpmLossItem78()));
	}
}
